﻿using System;

namespace Cubicle.Core.Repository.HandleParsers
{
    public class ExcelHandleParserTransient : ExcelHandleParserBase
    {

        public ExcelHandleParserTransient(char prefix, string name)
            : base(prefix, name) { }

        #region Overrides of HandleParser

        public override string KeyToHandle(string key)
        {
            return String.IsNullOrEmpty(Name)
                       ? PrefixStr + SeparatorStr + GetNextNumber()
                       : String.Join(SeparatorStr, Name, PrefixStr, GetNextNumber());
        }

        public override string HandleToKey(string handle)
        {
            return null;
        }

        #endregion
    }
}